package com.bawei.yangzongcai___day2.MaiDongFangQi.day15;

import java.net.HttpRetryException;

import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * create by ertu
 * create on 2021/8/2
 * description
 */
public class Okmmvvppclass {
    public  static Okmmvvppclass okmmvvppclass;
    public static  Okmmvvppclass getOkmmvvppclass()
    {
        if (okmmvvppclass==null)
        {
            okmmvvppclass = new Okmmvvppclass();
        }
        return okmmvvppclass;
    }


    public Retrofit retrofit (String qian)
    {
        return new Retrofit.Builder().baseUrl(qian)
                .client(new OkHttpClient.Builder().addInterceptor(new HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY)).build())
                .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
                .addConverterFactory(GsonConverterFactory.create())
                .build();
    }




}
